import { system as systemHttp, application as http } from '@zh/common-utils/http'

export { http }

/**
 * 获取接口分类
 * @param {} record
 * @returns
 */
export function getRecordBasic (record) {
  return systemHttp.get('system/SysDict/getCode/JKFL', record)
}

/**
 * 接口列表
 * @param {*} record
 * @returns
 */
export function getRecordList (record) {
  return http.post('app/sysOpenApi/page', record)
}

/**
 * 删除接口
 * @param {String} recordId
 */
export function deleteRecord (recordId) {
  return http.get('app/sysOpenApi/del/' + recordId)
}

/**
 * 修改接口管理
 * @param {*} record
 * @returns
 */
export function updateRecord (record) {
  return http.post('app/sysOpenApi/update', record)
}

/**
 * 新增接口
 * @param {*} record
 * @returns
 */
export function addRecord (record) {
  return http.post('app/sysOpenApi/insert', record)
}

export function getDictGetCode (code) {
  return systemHttp.get('system/SysDict/getCode/' + code, {
    needToken: false
  })
}